package main

import (
	"flag"
	"fmt"
	"net/http"
	_ "net/http/pprof"
	"wscoin/exchange"
)

/**
 * ws-quant
 * support
 * ws-binance
 * ws-ftx
 * ws-xt-contract
 * ws-xt-contract-user
 * ws-xt-contract-user test-key:'{"accesskey":"b1000aa0-9119-4ce7-a963-e7a0fe0055cb","secretkey":"b9992066608e6b84b531cbf1bf36b06e9a79add8"}'
 *
 * env = WSCOINENV 环境变量
 * dev | test | pro
**/
func main() {

	file := flag.String("file", "config/cfg.yaml", "config file")
	// ex := flag.String("ex", "binance", "quant")
	// ex := flag.String("ex", "ftx", "quant")
	// ex := flag.String("ex", "xtContract", "quant")
	ex := flag.String("ex", "xt4Spot", "quant")
	// ex := flag.String("ex", "xtContractUser", "quant")
	port := flag.String("p", "12000", "port")
	start := flag.Int("s", 0, "startSliceIndex")
	end := flag.Int("e", -1, "endSliceIndex")

	flag.Parse()
	fmt.Println(*file, *ex, *port, *start, *end)

	server := exchange.NewServer(*ex, *start, *end)
	server.Run(*file)

	_ = http.ListenAndServe("0.0.0.0:"+*port, nil)

}
